#ifndef _LOGSIMPL_H_
#define _LOGSIMPL_H_

#include "stdafx.h"

class CLogsImpl : public ILogs, public IPlugin, public IPluginRun, public CUnknownImp, public CSemThread, public CTimeThread
{
public:
    CLogsImpl(void);
    virtual ~CLogsImpl(void);

public:
    BEGIN_STDCOM_MAP
    STDCOM_INTERFACE_ENTRY_UNKNOWN_(ILogs)
    STDCOM_INTERFACE_ENTRY(IPlugin)
    STDCOM_INTERFACE_ENTRY(IPluginRun)
    STDCOM_INTERFACE_ENTRY(ILogs)
    END_STDCOM_MAP

    // IPlugin
    std_method(Init)(IBase* pRot, IBase* pBase);
    std_method(Uninit)();

    // IPluginRun
    std_method(Start)(_pid_t pid, unsigned int type);
    std_method(Stop)(unsigned int exit);

    // ILogs
    std_method(PostLog)(UCHAR* pBuf, ULONG Size);
    std_method(AddObject)(LPCSTR name, UINT len, IBase* pFilter);
    std_method(ReleaseObject)(LPCSTR name, UINT len);

public:
    std_method(Sem_Thread_Run)();
    std_method(GetRuleFiles)();
    std_method(LoadRuleFiles)();
    std_method(PushFile)(const basic_tchar* file);
    std_method(UploadTask)();
    std_method(SendSemThread)();
    std_method(ProcessTask)(LogDataPtr cmd);
    std_method(ReadRuleFile)(const path_string& file);
    std_method(SyncTable)(sjsoncptr JsRoot);
    std_method(Time_Thread_Run)();

private:
    _lComPtr<IRot> m_pRot;
    _lComPtr<ILogDataBase> m_pILogDataBase;

private:
    TaskList m_ListJson;
    CAutoLock m_lock;
    RuleList m_RuleFiles;
};

#endif
